<?php
namespace app\admin\validate;
use think\Validate;

/**
 * 题目信息验证器
 * Created by PhpStorm.
 * User: tyll
 * Date: 2019/10/22
 * Time: 16:12
 */
class ClassTi extends Validate{

    protected $rule = [
        'ckid'      => 'require',
        'question'  => 'require',
        'option'    => 'require',
        'answer'    => 'require',
        'cailiao'   => 'require'
    ];

    protected $message = [
        'ckid.require'      => '题库id必须填写',
        'question.require'  => '问题必须填写',
        'option.require'    => '选项必须填写',
        'answer.require'    => '答案必须填写',
        'cailiao.require'   => '材料必须填写'
    ];

    protected $scene = [
        'add'  => ['ckid','question','option','answer'],
        'edit' => ['ckid','question','option','answer']
    ];
}